<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>元素间缝隙</title>
    <style>
        div{
            width: 400px;
            height: 200px;
            background-color: gray;
            font-size: 0px; /*父元素设为0，子元素根据实际情况设置大小*/
        }
        .s1{
            background-color: skyblue;
            font-size: 20px;
        }
        .s2{
            background-color: orange;
            font-size: 20px;
        }
        .s3{
            background-color: green;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <div>
        <!-- 行内元素块之间有空隙 -->
        <span class="s1">span第一块</span>
        <span class="s2">span第二块</span>
        <span class="s3">span第三块</span>
    </div>
</body>
</html>